package targetIndices;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution {
    public List<Integer> targetIndices(int[] nums, int target) {
        int[] marks = new int[101];
        for (int i = 0; i < nums.length; i++) {
            marks[nums[i]] ++;
        }
        List<Integer> ans = new ArrayList<>();
        if(nums[target] ==0 ){
            return ans;
        }
        int index = 0;
        for (int i = 0; i <target; i++) {
            index+=nums[i];
        }
        for (int i = 1; i <= nums[target]; i++) {
            ans.add(i+index);
        }
        return ans;
    }
}
